Boolean value (True or False).
IsDate returns True if the given String or Number value can be converted to a valid Date and returns False otherwise. A valid Date is any date between January 1, 100 through December 31, 9999.
If you want to convert a String value to a Date using the functions CDate or DateValue, use the IsDate function first to check if the conversion will succeed. See below for an example.
The following examples are applicable to both Basic and Crystal syntax:
Also returns True since the number 100 is interpreted as 100 days from Dec. 30, 1899, which is April 9, 1900.
Returns False since 1999 is not a leap year and so the String cannot be converted to a Date.
Suppose an orders report is grouped monthly by order date. Here is a formula that returns the Date value that is extracted from the GroupName String field. If the report is a TopN report, the GroupName field can have a value "Others". This can not be converted into a Date, and so IsDate is used to prevent an error from being generated in the call to CDate:
s = GroupName ({Orders.Order Date}, "monthly")
Local StringVar s := GroupName ({Orders.Order Date}, "monthly");
Returns the Date value May 1, 1998 if the GroupName field value is "May - 1998". Returns the null Date (a non
This function is similar to the Visual Basic function of the same name, except that it works specifically with Crystal Report's Date type which holds date values only.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |